package com.LFLWZ.controller;

import com.LFLWZ.ServiceImpl.historyImpl;
import com.LFLWZ.beans.Dto.Dto;
import com.LFLWZ.beans.Vo.listQuery;
import com.LFLWZ.utils.DtoUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("history")
public class historyController {
    @Autowired
    private historyImpl history;
    @PostMapping("selal")
    public Dto selal(@RequestBody listQuery listQuery){
        System.out.println(listQuery);
        return  DtoUtil.returnSuccessData(history.sela(listQuery.getUserId(),listQuery.getName()));
    }
}
